﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

using SharedGenomics.Core;
using SharedGenomics.Domain;
using SharedGenomics.Workbench.Core;

namespace SharedGenomics.Workbench.Models
{
    public class LocalJobDetailsRepository : IJobDetailsRepository
    {
        public LocalJobDetailsRepository(string detailsFilePath)
            : this(new TextFileReader(detailsFilePath))
        {
        }

        public LocalJobDetailsRepository(IEnumerable<string> detailsFile)
        {
            this.ParseJobDetailsFile(detailsFile ?? Enumerable.Empty<string>());
        }

        public Maybe<IEnumerable<SharedGenomics.DataTransfer.JobDetails>> GetUserJobs(SharedGenomics.DataTransfer.JobSpecification specification)
        {
            throw new NotImplementedException();
        }

        private void ParseJobDetailsFile(IEnumerable<string> detailsFileLines)
        {
            Debug.Assert(detailsFileLines != null);
            throw new NotImplementedException();
            //this.JobDetails = detailsFileLines.Where(l => !(l.IsEmptyOrWhitespace() || l.StartsWith("#"))).Select(line => this.FromResultsLine(line)).ToArray();
        }
    }
}
